/*
 * To change this template, choise Tools | Templates
 * and open the template in the editor.
 */
package session03;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author macbookpro
 */
public class AccountReader {
    public static void main(String[] args) {
        ObjectInputStream ois = null;
        try {
            Account a = null;
            ois = new ObjectInputStream(new FileInputStream("Account.dat"));
            a = (Account) ois.readObject();
            System.out.println(a);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(AccountReader.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(AccountWriter.class.getName()).log(Level.SEVERE, null, ex);
        } finally {
            try {
                ois.close();
            } catch (IOException ex) {
                Logger.getLogger(AccountWriter.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }
}
